package top.tagao.study02_Set;

import com.sun.org.apache.bcel.internal.generic.NEW;

import java.util.Comparator;
import java.util.TreeSet;

/**
 * @author fu-xiao-liu
 * @Date 2022/4/17 0:18
 */
public class study_05_TreeSet {
    public static void main(String[] args) {
        TreeSet treeSet = new TreeSet( (o1,o2)->{
            return  ((String)o2).compareTo((String) o1);
        }
        );
         //treeSet = new TreeSet();
        treeSet.add("ab");
        treeSet.add("cb");
        treeSet.add("ca");
        treeSet.add("bb");
        System.out.println(treeSet);
    }
}
